<?php

$files = scandir('./graphs/highlow');
$nr = $_GET['nr'];

echo "<font FACE='Arial, Helvetica, Geneva'>\n";

if (!isSet($nr)) {
	echo "<h2>Otrevliga stocks</h2>\n";
	foreach($files as $i => $file){
		if ($i > 1) {
			$name = str_replace('.gif','',$file);
			echo "<a href=\"?nr=$i\">$name</a><br>\n";
		}
	} 
} else {
	$name = str_replace('.gif','',$files[$nr]);
	echo "<a href=\"?\">Tillbaka</a>\n<h3>$name</h2>\n";
	$nextNr = $nr+1;
	echo "<a href=\"?nr=$nextNr\"><img src=\"/graphs/highlow/".$files[$nr]."\" width=\"1024\" height=\"500\"></a>\n";
}

echo "</font>";

?>